package com.example.myapplication02.paging.room;

import androidx.lifecycle.LiveData;
import androidx.paging.DataSource;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;

import java.util.List;

@Dao
public interface UserDao {

    @Insert
    void insert(User... user);

    @Query("delete from user")
    void deleteAllUser();

    @Query("select * from user")
    DataSource.Factory<Integer, User> getAllUser();

    @Query("select * from user where id = 1")
    LiveData<User> getUser();

}
